package com.example.fp.zbs.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.fp.zbs.entity.Overseas;
import com.example.fp.zbs.entity.Sort;
import com.example.fp.zlz.entity.Gametype;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.fp.cgc.entity.Click;
import com.example.fp.zbs.entity.Overseas;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OverseasMapper extends BaseMapper<Overseas>{
    @Select("select * from overseas")
    List<Overseas> selectalloverseas();
    @Select("select sort as name,count(*) as value from overseas group by sort order by value desc limit 10")
    List<Sort> selectsort();

    @Select("(select appname,sort,clickperday,Activepercentage from overseas where sort = 'tools'order by clickperday asc limit 10)\n" +
            "union\n" +
            "(select appname,sort,clickperday,Activepercentage from overseas where sort='others'order by clickperday asc limit 10)\n" +
            "union\n"
            )
    List<Gametype> selectbytype();

}

